From: Olivier Fourdan Date: Fri, 27 Mar 2020 13:40:52 +0000 (+0100) Subject: wayland: Use a GdkSeat as key for our internal hash table X-Git-Tag: archive/raspbian/4.4.1+ds1-2+rpi1^2~18^2~19^2~8^2~5 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=5ac73be976a87558645b32207eba3be67506461b;p=gtk4.git wayland: Use a GdkSeat as key for our internal hash table With the current implementation, we use a `wl_seat` as the key for our internal has table where we store the Wayland shortcuts inhibitors. There is however no technical reason for this, and we could use a GdkSeat instead, which will ease the implementation of the GdkToplevel shortcut inhibition API. --- diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c index 12f88990c8..9cf2189396 100644 --- a/gdk/wayland/gdksurface-wayland.c +++ b/gdk/wayland/gdksurface-wayland.c @@ -4112,9 +4112,9 @@ gdk_wayland_surface_set_transient_for_exported (GdkSurface *surface, static struct zwp_keyboard_shortcuts_inhibitor_v1 * gdk_wayland_surface_get_inhibitor (GdkWaylandSurface *impl, - struct wl_seat *seat) + GdkSeat *gdk_seat) { - return g_hash_table_lookup (impl->shortcuts_inhibitors, seat); + return g_hash_table_lookup (impl->shortcuts_inhibitors, gdk_seat); } void @@ -4131,13 +4131,13 @@ gdk_wayland_surface_inhibit_shortcuts (GdkSurface *surface, return; if (gdk_wayland_surface_get_inhibitor (impl, seat)) - return; /* Already inhibitted */ + return; /* Already inhibited */ inhibitor = zwp_keyboard_shortcuts_inhibit_manager_v1_inhibit_shortcuts ( display->keyboard_shortcuts_inhibit, wl_surface, seat); - g_hash_table_insert (impl->shortcuts_inhibitors, seat, inhibitor); + g_hash_table_insert (impl->shortcuts_inhibitors, gdk_seat, inhibitor); } void @@ -4145,15 +4145,14 @@ gdk_wayland_surface_restore_shortcuts (GdkSurface *surface, GdkSeat *gdk_seat) { GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface); - struct wl_seat *seat = gdk_wayland_seat_get_wl_seat (gdk_seat); struct zwp_keyboard_shortcuts_inhibitor_v1 *inhibitor; - inhibitor = gdk_wayland_surface_get_inhibitor (impl, seat); + inhibitor = gdk_wayland_surface_get_inhibitor (impl, gdk_seat); if (inhibitor == NULL) return; /* Not inhibitted */ zwp_keyboard_shortcuts_inhibitor_v1_destroy (inhibitor); - g_hash_table_remove (impl->shortcuts_inhibitors, seat); + g_hash_table_remove (impl->shortcuts_inhibitors, gdk_seat); } GdkSurface *